package pers.wechat.config;

/**
 * 微信配置信息
 */
public class WeChatConfig {

    public WeChatConfig() {
    }

    public WeChatConfig(WeChatConfig weChatConfig) {
        this.appId = weChatConfig.appId;
        this.appSecret = weChatConfig.appSecret;
        this.mchId = weChatConfig.mchId;
        this.key = weChatConfig.key;
        this.notifyUrl = weChatConfig.notifyUrl;
    }

    private String appId;// 微信分配的id
    private String appSecret;// 程序秘钥
    private String mchId;// 微信商户号
    private String key;
    private String notifyUrl;

    public String getAppId() {
        return appId;
    }

    public String getAppSecret() {
        return appSecret;
    }

    public String getMchId() {
        return mchId;
    }

    public String getKey() {
        return key;
    }

    public String getNotifyUrl() {
        return notifyUrl;
    }

    /**
     * 微信配置信息构建
     */
    public static class Builder{
        private WeChatConfig weChatConfig;
        public Builder(){
            weChatConfig = new WeChatConfig();
        }
        public Builder addAppId(String appId){
            weChatConfig.appId = appId;
            return this;
        }
        public Builder addAppSecret(String appSecret){
            weChatConfig.appSecret = appSecret;
            return this;
        }
        public Builder addMchId(String mchId){
            weChatConfig.mchId = mchId;
            return this;
        }
        public Builder addKey(String key){
            weChatConfig.key = key;
            return this;
        }
        public Builder addNotifyUrl(String notifyUrl){
            weChatConfig.notifyUrl = notifyUrl;
            return this;
        }
        public WeChatConfig build(){
            return new WeChatConfig(weChatConfig);
        }
    }
}
